return array(
'module_name'=>'admin',//代码生成的应用目录  注:这里需根据实际情况手动配置
'tableName'=>'<?=$table_info['Name']?>',//表名必填
'tableCnName'=>'<?=str_replace('表','',$table_info['Comment'])?>',//表中文名必填  注:这里需根据实际情况手动配置

'priTable'=>'ptf_privilege',//权限表名必填   注:这里需根据实际情况手动配置

<?php
	function is_require($item){
		if($item['Null'] == 'NO' && $item['Default']===null){
			return true;
		}
			return false;
	}
	$pk = 'id';//表中的主键字段
	//tp5的验证场景
	$scene = array();
	foreach ($table_fields as $k => $v)
	{
		if($v['Key'] == 'PRI')
		{
			$pk = $v['Field'];
			continue ;
		}
        //image|logo|face|img|pic|
		if(preg_match('/(time|del|delete|lev)/', $v['Field'])){
			continue;
		}
		$scene[] = "'{$v['Field']}'";
	}
	$scene_str = implode(',',$scene);
	$message = array();//验证规则提示信息
	$form = array();//动态表单字段
	$search = array();
?>

//表中的主键字段
'pri_key'=>'<?=$pk?>',
/*********TP5验证规则********/
'validate_rule'=>"array(
<?php foreach($table_fields as $k=>$v):
if($v['Key'] == 'PRI' || preg_match('/(time|del|delete|lev)/', $v['Field'])){
continue;
}
if(is_require($v) && preg_match('/(tel|phone)/',$v['Field'])) {?>
		'<?= $v['Field'] ?>'=>'require|regex:^1[356789]\d{9}',
<?php
	$message[] = array($v['Field'], 'require', $v['Comment'] . '不能为空');
	$message[] = array($v['Field'], 'regex', $v['Comment'] . '的值不是正确的手机号码');
	$form[] = array('field' => $v['Field'], 'text' => $v['Comment'], 'type' => 'text', 'required'=>1,'is_visible' => 1, 'placeholder' => '请输入' . $v['Comment'], 'validate' => 'datatype="m" errormsg="'.$v['Comment'].'格式不正确"');
}elseif(!is_require($v) && preg_match('/(tel|phone)/',$v['Field'])){ ?>
		'<?=$v['Field']?>'=>'regex:^1[356789]\d{9}',
<?php
	$message[] = array($v['Field'],'regex',$v['Comment'].'的值不是正确的手机号码');
	$form[] = array('field'=>$v['Field'],'text'=>$v['Comment'],'required'=>0,'type'=>'text','is_visible'=>1,'placeholder'=>'请输入'.$v['Comment'],'validate'=>'datatype="m" ignore="ignore"');
}elseif(is_require($v) && preg_match('/email/',$v['Field'])){ ?>
		'<?=$v['Field']?>'=>'require|email',
<?php
	$message[] = array($v['Field'],'require',$v['Comment'].'不能为空');
	$message[] = array($v['Field'],'email',$v['Comment'].'的值不是正确的邮箱格式');
	$form[] = array('field'=>$v['Field'],'text'=>$v['Comment'],'type'=>'text','required'=>1,'is_visible'=>1,'placeholder'=>'请输入'.$v['Comment'],'validate'=>'datatype="e" ignore="ignore" errormsg="'.$v['Comment'].'格式不正确"');
}elseif(!is_require($v) && preg_match('/email/',$v['Field'])) { ?>
		'<?= $v['Field'] ?>'=>'email',
	<?php
	$message[] = array($v['Field'], 'email', $v['Comment'] . '的值不是正确的邮箱格式');
	$form[] = array('field' => $v['Field'], 'text' => $v['Comment'],'required'=>0, 'type' => 'text', 'is_visible' => 1, 'placeholder' => '请输入' . $v['Comment'], 'validate' => 'datatype="e"');
}elseif((is_require($v) && preg_match('/(pass)/',$v['Field'])) || (!is_require($v) && preg_match('/(pass)/',$v['Field']))){ ?>
		'<?=$v['Field']?>'=>'require',
<?php
	$message[] = array($v['Field'],'require',$v['Comment'].'不能为空');
	$form[] = array('field'=>$v['Field'],'text'=>$v['Comment'],'required'=>1,'type'=>'password','is_visible'=>0,'placeholder'=>'请输入'.$v['Comment'],'validate'=>'required  equalTo="#password"  errormsg="'.$v['Comment'].'格式不正确"');
}elseif(is_require($v) && strpos($v['Type'],'char') === 0){?>
		'<?=$v['Field']?>' => 'require|max:<?php $_s1=str_replace(array('char(',')'),array('',''),$v['Type']);echo $_s1;?>',
<?php 
	$message[] = array($v['Field'],'require',$v['Comment'].'不能为空');
	$message[] = array($v['Field'],'max',$v['Comment'].'的值不能超过'.$_s1.'个字符');
	$form[] = array('field'=>$v['Field'],'text'=>$v['Comment'],'required'=>1,'type'=>'text','is_visible'=>1,'placeholder'=>'请输入'.$v['Comment'],'validate'=>'datatype="s2-'.$_s1.'"  errormsg="'.$v['Comment'].'超出长度范围"');
	$search[] = array('field'=>$v['Field'],'comment'=>$v['Comment'],'type'=>'text','required'=>1);
}elseif(!is_require($v) && strpos($v['Type'],'char') === 0){ ?>
		'<?=$v['Field']?>' => 'max:<?php $_s1=str_replace(array('char(',')'),array('',''),$v['Type']);echo $_s1;?>',
<?php
	$message[] = array($v['Field'],'max',$v['Comment'].'的值不能超过'.$_s1.'个字符');
	$form[] = array('field'=>$v['Field'],'text'=>$v['Comment'],'type'=>'text','required'=>0,'is_visible'=>1,'placeholder'=>'请输入'.$v['Comment'],'validate'=>'datatype="s2-'.$_s1.'" ignore="ignore"');
	$search[] = array('field'=>$v['Field'],'comment'=>$v['Comment'],'type'=>'text','required'=>0);
}elseif(preg_match('/(image|logo|face|img|pic)/', $v['Field'])){
    $form[] = array('field'=>$v['Field'],'text'=>$v['Comment'],'type'=>'file','required'=>0,'is_visible'=>0,'placeholder'=>'请输入'.$v['Comment'],'validate'=>'');
}elseif(is_require($v) && strpos($v['Type'],'varchar') ===0){?>
		'<?=$v['Field']?>' => 'require|max:<?php $_s1=str_replace(array('varchar(',')'),array('',''),$v['Type']);echo $_s1?>',
<?php 
	$message[] = array($v['Field'],'require',$v['Comment'].'不能为空');
	$message[] = array($v['Field'],'max',$v['Comment'].'的值不能超过'.$_s1.'个字符');
	$form[] = array('field'=>$v['Field'],'text'=>$v['Comment'],'type'=>'text','required'=>1,'is_visible'=>1,'placeholder'=>'请输入'.$v['Comment'],'validate'=>'datatype="s2-'.$_s1.'"  errormsg="'.$v['Comment'].'超出长度范围"');
	$search[] = array('field'=>$v['Field'],'comment'=>$v['Comment'],'type'=>'text','required'=>1);
}elseif(!is_require($v) && strpos($v['Type'],'varchar') ===0){ ?>
		'<?=$v['Field']?>' => 'max:<?php $_s1=str_replace(array('varchar(',')'),array('',''),$v['Type']);echo $_s1?>',
<?php
	$message[] = array($v['Field'],'max',$v['Comment'].'的值不能超过'.$_s1.'个字符');
	$form[] = array('field'=>$v['Field'],'text'=>$v['Comment'],'type'=>'text','required'=>0,'is_visible'=>1,'placeholder'=>'请输入'.$v['Comment'],'validate'=>'datatype="s2-'.$_s1.'" ignore="ignore"  errormsg="'.$v['Comment'].'超出长度范围"');
	$search[] = array('field'=>$v['Field'],'comment'=>$v['Comment'],'type'=>'text','required'=>0);
}elseif(strpos($v['Type'],'tinyint') !== FALSE){ ?>
    <?php
    $form[] = array('field'=>$v['Field'],'text'=>$v['Comment'],'required'=>1,'type'=>'radio','is_visible'=>1,'placeholder'=>'请选择'.$v['Comment'],'validate'=>'datatype="*"  nullmsg="请选择'.$v['Comment'].'"','values'=>"array('否','是')");
    //$form[] = array('field'=>$v['Field'],'text'=>$v['Comment'],'type'=>'select','is_visible'=>0,'placeholder'=>'请输入'.$v['Comment'],'validate'=>'datatype="*"  nullmsg="请选择'.$v['Comment'].'"','values'=>"array('否','是')");
}
elseif(is_require($v) && strpos($v['Type'],'int') !== FALSE){ ?>
		'<?=$v['Field']?>'=>'require|number',
<?php
	$message[] = array($v['Field'],'require',$v['Comment'].'不能为空');
	$message[] = array($v['Field'],'number',$v['Comment'].'的值必须是一个整数');
	$form[] = array('field'=>$v['Field'],'text'=>$v['Comment'],'type'=>'text','required'=>1,'is_visible'=>1,'placeholder'=>'请输入'.$v['Comment'],'validate'=>'datatype="n"  errormsg="'.$v['Comment'].'是数字类型"');
    $search[] = array('field'=>$v['Field'],'comment'=>$v['Comment'],'type'=>'text','required'=>1);
}elseif(!is_require($v) && strpos($v['Type'],'int') !== FALSE){ ?>
		'<?=$v['Field']?>'=>'number',
<?php
	$message[] = array($v['Field'],'number',$v['Comment'].'的值必须是一个整数');
	$form[] = array('field'=>$v['Field'],'text'=>$v['Comment'],'type'=>'text','required'=>0,'is_visible'=>1,'placeholder'=>'请输入'.$v['Comment'],'validate'=>'datatype="n" ignore="ignore"  errormsg="'.$v['Comment'].'是数字类型"');
    $search[] = array('field'=>$v['Field'],'comment'=>$v['Comment'],'type'=>'text','required'=>0,);
}elseif(is_require($v) && strpos($v['Type'],'decimal') !== FALSE){ ?>
		'<?=$v['Field']?>'=>'require|regex:\d+\.?\d{0,2}',
<?php
	$message[] = array($v['Field'],'require',$v['Comment'].'不能为空');
	$message[] = array($v['Field'],'regex',$v['Comment'].'的值不是正确的货币格式');
	$form[] = array('field'=>$v['Field'],'text'=>$v['Comment'],'type'=>'text','required'=>1,'is_visible'=>1,'placeholder'=>'请输入'.$v['Comment'],'validate'=>'datatype="n" regex="\d+\.?\d{0,2}"  errormsg="'.$v['Comment'].'不是正确的货币格式"');
}elseif(!is_require($v) && strpos($v['Type'],'decimal') !== FALSE){ ?>
		'<?=$v['Field']?>'=>'regex:\d+\.?\d{0,2}',
<?php
	$message[] = array($v['Field'],'regex',$v['Comment'].'的值不是正确的货币格式');
	$form[] = array('field'=>$v['Field'],'text'=>$v['Comment'],'type'=>'text','required'=>0,'is_visible'=>1,'placeholder'=>'请输入'.$v['Comment'],'validate'=>'datatype="n" ignore="ignore" regex="/\d+\.?\d{0,2}/"');
}elseif($v['Type'] == 'text'){ ?>
<?php
	$form[] = array('field'=>$v['Field'],'text'=>$v['Comment'],'type'=>'textarea','required'=>0,'is_visible'=>0,'placeholder'=>'请输入'.$v['Comment'],'validate'=>'  errormsg="'.$v['Comment'].'超出长度范围"');
}elseif(strpos($v['Type'], 'enum') !== FALSE){ ?>
<?php
	$form[] = array('field'=>$v['Field'],'text'=>$v['Comment'],'required'=>0,'type'=>'radio','is_visible'=>1,'placeholder'=>'请输入'.$v['Comment'],'validate'=>'datatype="*"  nullmsg="请选择'.$v['Comment'].'"','values'=>"array('否','是')");
	//$form[] = array('field'=>$v['Field'],'text'=>$v['Comment'],'type'=>'select','is_visible'=>0,'placeholder'=>'请选择'.$v['Comment'],'validate'=>'datatype="*"  nullmsg="请选择'.$v['Comment'].'"','values'=>"array('否','是')");
}else{
	$form[] = array('field'=>$v['Field'],'text'=>$v['Comment'],'required'=>0,'type'=>'radio','is_visible'=>1,'placeholder'=>'请输入'.$v['Comment'],'validate'=>'datatype="*"  nullmsg="请选择'.$v['Comment'].'"','values'=>"array('否','是')");
	//$form[] = array('field'=>$v['Field'],'text'=>$v['Comment'],'required'=>0,'type'=>'checkbox','is_visible'=>0,'placeholder'=>'请输入'.$v['Comment'],'validate'=>'datatype="need1"  nullmsg="请选择'.$v['Comment'].'"','values'=>"array('否','是')");
	//$form[] = array('field'=>$v['Field'],'text'=>$v['Comment'],'type'=>'select','is_visible'=>0,'placeholder'=>'请输入'.$v['Comment'],'validate'=>'datatype="*"  nullmsg="请选择'.$v['Comment'].'"','values'=>"array('否','是')");
}endforeach;?>
	)",
/*********TP5验证规则错误提示信息********/
'validate_message'=>"array(
<?php foreach($message as $k=>$v): ?>
		'<?=$v[0]?>.<?=$v[1]?>'=>'<?=$v[2]?>',
<?php endforeach;?>
)",
/**************TP5的验证场景****************/
'validate_scene'=>"array(
		'add'=>array(<?=$scene_str?>),
		'edit'=>array('<?=$pk?>',<?=$scene_str?>),
	)",

/*********生成动态表单的字段配置信息********/
/**
	注意:每个表的配置这里的表单字段需要根据实际情况手动修改
**/
'form_fields'=>array(
<?php foreach($form as $k=>$v):?>
		'<?=$v['field']?>'=>array(
			'text'=>'<?=$v['text']?>',
			'type'=>'<?=$v['type']?>',
			'is_visible'=><?=$v['is_visible']?>,
			'required'=><?=$v['required']?>,
			'placeholder'=>'<?=$v['placeholder']?>',
			'validate'=>'<?=$v['validate']?>',
		<?php if($v['type'] == 'radio' || $v['type']=='checkbox' || $v['type'] == 'select'){?>
			'values'=><?=$v['values']?>,
	<?php } ?>),
<?php endforeach;?>
        ),


/*********搜索字段配置信息********/
'search'=>array(
        '-1'=>array(
            'field'=>'<?=$pk?>',
            'type'=>'text',
            'required'=>1, //required为1必须搜索
            'comment'=>'ID',
    ),

	<?php foreach($search as $k=>$v){ ?>
		'<?=$k?>'=>array(
            'field'=>'<?=$v['field']?>',
            'type'=>'<?=$v['type']?>',
            'required'=><?=$v['required']?>,
            'comment'=>'<?=$v['comment']?>',
        ),
	<?php } ?>
		),

/*********详情字段配置信息********/
'view'=>array(
<?php foreach($table_fields as $k=>$v){ ?>
    '<?=$k?>'=>[
        'comment'=>'<?php if(!$v['Comment']){echo 'ID';}else{echo $v['Comment'];}?>',
        'field'=>'<?=$v['Field']?>',
    ],
<?php } ?>
),

);